package com.zcc.springbootneo4j.dao;

import com.zcc.springbootneo4j.entity.Disease;
import com.zcc.springbootneo4j.entity.Drugs;
import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface DrugsInf extends Neo4jRepository<Drugs, Long> {
    /**
     * 查询所有药物
     *
     * @return
     */
    @Query("MATCH (n:药物) RETURN n ")
    List<Drugs> getDisease();

    /**
     * 创建药物名称
     *
     * @param name
     * @return
     */
    @Query("create (n:药物{ywmc:$name}) RETURN n")
    List<Drugs> createDiseaseName(@Param("name") String name);
}
